/*************************************************
Author: will
Date: 1/28/2013
Description:
Notes: 
*************************************************/

#ifndef __CAlchemyConfig_h__
#define __CAlchemyConfig_h__

#include "CTArray.h"
#include "commclass.h"

class CAlchemyConfig
{
public:
    CAlchemyConfig() 
    {
        _auiAlchemyGetSilver.m_iUsedCount = _auiAlchemyGetSilver.GetCount();
    }

    virtual ~CAlchemyConfig() 
    {
    }

    int AddConfig(unsigned char ucLevel, unsigned int uiGetSilver)
    {
        if (ucLevel <= 0 || ucLevel > MAX_ROLE_LEVEL)
        {
            CT_ERROR(("error level %d", ucLevel));
            return RET_SYSTEM_FAIL;
        }

        _auiAlchemyGetSilver[ucLevel] = uiGetSilver;
        return 0;
    }

    int GetConfig(unsigned char ucLevel, unsigned int& uiGetSilver)
    {
        if (ucLevel > MAX_ROLE_LEVEL)
        {
            CT_ERROR(("error level %d", ucLevel));
            return RET_SYSTEM_FAIL;
        }

        uiGetSilver = _auiAlchemyGetSilver[ucLevel];
        return 0;
    }

private:
    CTLib::CTArray<unsigned int, MAX_ROLE_LEVEL + 1>  _auiAlchemyGetSilver;
};


#endif // __CAlchemyConfig_h__

